﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>新闻</title>
    <link rel="shortcut icon"  href="images/favicon.ico"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<LINK href="<%=path %>/admin/css/admin.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=path %>/admin/js/myJs.js" charset=utf-8></script>
	<link href="<%=path %>/admin/css/myStyle.css" rel="stylesheet" type="text/css" />
	<!-- jQuery -->
	<script type="text/javascript" src="<%=path%>/js/jquery-1.5.1.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/json2.js"></script>
	<!-- jQuery -->
	<script type="text/javascript" src="<%=path%>/admin/js/ajax.js"></script>
	<script type="text/javascript" language="javascript">
		//发送请求，筛选结果
		function select(){
			var newsTitle=document.getElementById("newsTitle").value;
			var newsType=document.getElementById("newsType").value;
			var action="news_selectLike.html?page.pageIndex=1&page.pageSize=15&news.newsTitle="+newsTitle+"&news.newsType="+newsType;
			window.location.href=action;
		}
		
	</script>
  </head>
  
  <body>
  <TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
  <TR height=20>
    <TD></TD></TR>
  <TR height=22>
    <TD style="PADDING-LEFT: 20px; FONT-WEIGHT: bold; COLOR: #ffffff" 
    align=middle background="<%=path %>/admin/images/title_bg2.jpg">新闻列表</TD></TR>
  <TR bgColor=#ecf4fc height=12>
    <TD></TD></TR>
  <TR height=20>
    <TD></TD></TR></TABLE>
    
  <table cellSpacing=0 cellPadding=0 width="95%" align=center id="table1" class="tableborder" style="border-left:0px;" >
   <tr align="right"  style="border:0px;">
		<td colspan="9" style="border:0px;">
			筛选&nbsp;&nbsp;&nbsp;&nbsp;	
			新闻标题：<input type="text" id="newsTitle" name="news.newsTitle" />
			是否置顶：<select name="news.newsType" id="newsType">
							<option value="不限">不限
							<option value="置顶">已置顶
							<option value="未置顶">未置顶
					  </select>
				<button type="button" onclick="select();" class="allDelete">筛选</button>
			
		</td>
	</tr>
	
   <tr align="center"  style="color:#0066CC;">
		<th>选择</th><th>新闻标题</th><th>发布时间</th><th>操作</th>
	</tr>
	<s:iterator value="#attr.newsList" id="n">
   	<tr align="center" >
		<td><input type="checkbox" value="<s:property value="#n.newsId"/>"  name="newsId"/></td>
		<td><a href="news_detailNews.html?news.newsId=<s:property value="#attr.n.newsId" />"><s:property value="#attr.n.newsTitle" /></a></td>
		<td><s:property value="#attr.n.newsDate" />
		</td>
		<td>
			<!-- 置顶用AJAX -->
			<s:if test="#attr.n.newsType=='置顶'">
				<a href="javascript:void(0)" onclick="updateType(this,'<s:property value="#attr.n.newsId" />',this.name);" name="未置顶")>[取消置顶]</a>
			</s:if>
			<s:if test="#attr.n.newsType!='置顶'">
				<a href="javascript:void(0)"  onclick="updateType(this,'<s:property value="#attr.n.newsId" />',this.name);" name="置顶")>[置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;顶]</a>
			</s:if>
			<a href="news_detailNews.html?news.newsId=<s:property value="#attr.n.newsId" />">[详细]</a>
			<a href="news_preUpdate.html?news.newsId=<s:property value="#attr.n.newsId" />">[修改]</a>
			<a href="news_deleteNews.html?news.newsId=<s:property value="#attr.n.newsId" />" onclick="return confirm('确认删除?');">[删除]</a>
		</td>
	</tr>
	</s:iterator>
	<tr align="center"">
		<td><input type="checkbox" value="全选" id="selectAll" onclick="selectAll(this.checked,'newsId');" /></td>
		<td colspan="3" align="left">
			<button type="button" class="allDelete" onclick="deleteAll('news_deleteMore.html','newsId');">删除选中</button>
		</td>
	</tr>
	<tr align="center">
		<td colspan="9">
		<s:property value="#attr.link" escape="false" />
		</td>
	</tr>
  </table>


  </body>
</html>
